package com.nidu.demo.mail.dto;

import com.nidu.demo.base.BaseCmd;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Map;

/**
 * 邮件发送命令
 *
 * @author auto
 */
@Data
@Schema(description = "邮件发送命令")
@EqualsAndHashCode(callSuper = true)
public class MailSendCmd extends BaseCmd {

    @NotBlank(message = "接收邮箱地址不能为空")
    @Schema(description = "接收邮箱地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "user@example.com")
    private List<String> toMails;

    @Schema(description = "抄送邮箱地址", example = "cc@example.com")
    private List<String> ccMails;

    @Schema(description = "密送邮箱地址", example = "bcc@example.com")
    private List<String> bccMails;

    @NotBlank(message = "模板编码不能为空")
    @Schema(description = "模板编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "USER_REGISTER")
    private String templateCode;

    @Schema(description = "模板参数", example = "{\"username\":\"张三\"}")
    private Map<String, Object> templateParams;

}
